<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="com.kylin.module.shop.orm.*,
                 com.kylin.common.util.*,
				 com.kylin.common.dict.orm.Dict,
                 com.kylin.common.paginate.DisplayPage,
				 com.kylin.module.user.orm.*" %>
<%@ include file="../_deco/managetop.jsp"%>

<br>
<table class="tl050804" cellspacing="0" cellpadding="0">
  <tr>
    <td width="280"  align="center" valign="top">
			<%@ include file="../_deco/manageLeft.jsp"%>
		</td>
		<td align="left" valign="top">
<%
////////////////////右侧 内容区  /////////////////////// start
%>		
<table width="92%" cellspacing="0" cellpadding="0">
      <tr>
        <td height="30" class="ms02">&nbsp;&nbsp;<bean:message key="leads.01"/></td>
        <td align="right">欢迎</td>
      </tr>
	   <tr>
              <td colspan="2" bgcolor="CDCDCD" height="1"></td>
             
	   </tr>
    </table>
<br>
<form action="/module/shop/company/manageContent.do?CMD=manageContentList" method="post">		
<table width="90%" cellpadding="0" cellspacing="0">
	<tr>
<td  >
			<bean:message key="company.50"/><input name="title" type="text" > &nbsp;&nbsp; 
			<bean:message key="company.57"/><select name="type">
				<option></option>
			    <option value="<%=Content.TYPE_BUY%>"><bean:message key="company.49"/></option>
			    <option value="<%=Content.TYPE_SELL%>"><bean:message key="company.48"/></option>
			</select>

			<input type="submit" name="Submit" value="<bean:message key="base.74"/>">
		</td>
	</tr>
</table>
</form>
<mytag:MyActionMsg />
<script>
function toEdit(id){
       document.fo1.CMD.value="bfUpdate";
       document.fo1.id.value=id;
       document.fo1.submit();
}
  
function toDelete(id){
	if(confirm("<bean:message key='company.97'/>")){
       document.fo1.CMD.value="delete";
       document.fo1.id.value=id;
       document.fo1.submit();
    }
}
</script>
<table cellpadding="0" cellspacing="0" width="90%" align="center">
<form name="fo1" action="/module/shop/company/manageContent.do" method="post">
<input type="hidden" name="CMD"/>
<input type="hidden" name="id" />
	<tr>
		<td class="comp0701">
			 <bean:message key="company.56"/>
		</td>
	</tr>
<%
  if(request.getAttribute(Constants.KEY_REQUEST_RESULT )!=null){
     DisplayPage dispage = (DisplayPage)request.getAttribute(Constants.KEY_REQUEST_RESULT);
     out.println("<input type='hidden' name='searchId' value='"+dispage.getSearchId()+"' />");
     out.println("<input type='hidden' name='page' value='"+dispage.getPageNumber()+"' />");
     for(int i=0;i<dispage.getList().size();i++){
    	Content obj = (Content)dispage.getList().get(i);
%>
	<tr>
		<td align="left" class="comp04td">
			<table width="100%" cellpadding="0" cellspacing="0">
				<tr>
					<td rowspan="2" width="80">
						<%
						    if(Content.TYPE_BUY.equals(obj.getType()) )
						        out.println("<bean:message key='company.49'/>");
						    else if(Content.TYPE_SELL.equals(obj.getType()) )
						        out.println("<bean:message key='company.48'/>");
						%>
					</td>
					<td>
						<span class="compn"><%=JspHelper.checkNull(obj.getTitle()) %></span>
						<br>
						   <%=JspHelper.checkNull(obj.getContent()) %>&nbsp; 
    					<br><bean:message key="company.88"/>：<%=obj.getCreatedon() %>
					</td>
				</tr>
				<tr>
					<td align="right">
 						<input type="button" onclick="toEdit('<%=obj.getId() %>')" value="<bean:message key="base.58"/>">
						<input type="button" onclick="toDelete('<%=obj.getId() %>')" value="<bean:message key="base.60"/>">
					</td>
				</tr>
			</table>
		</td>
	</tr>
	<%} %>
</form>    
</table>
<%
     //调用共通方法生成翻页工具条
	 out.print(JspHelper.getPageBar(dispage,request.getRequestURL()+"?CMD=manageContentList"));
  } 
%>



<%
////////////////////右侧 内容区  /////////////////////// end
%>		
		</td>
	</tr>
</table>

